﻿using System;
using System.Collections.Specialized;
using System.IO;

using WebDavProcessor.Interfaces;

namespace WebDavProcessor.Methods
{
    public class WebDavSimpleResponse : IWebDavResponse
    {
        private int responseStatus;
        private string responseDescription;
        private NameValueCollection responseHeaders;
        private Stream responseStream;

        int IWebDavResponse.StatusCode { get { return responseStatus; } set { responseStatus = value; } }
        string IWebDavResponse.StatusDescription { get { return responseDescription; } set { responseDescription = value; } }
        NameValueCollection IWebDavResponse.Headers { get { return responseHeaders; } set { responseHeaders = value; } }
        Stream IWebDavResponse.OutputStream { get { return responseStream; } set { responseStream = value; } }

        public WebDavSimpleResponse(int status, string description, NameValueCollection headers, Stream data)
        {
            responseStatus = status;
            responseDescription = description;
            responseHeaders = headers;
            responseStream = data;
        }
        public WebDavSimpleResponse(int status, string description)
        {
            responseStatus = status;
            responseDescription = description;
            responseHeaders = new NameValueCollection();
            responseStream = new MemoryStream();
        }
    }
}
